package com.chenglu.android.logistics.adapter;

import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.logistics.bean.LogisticsData;

import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023 3 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：物流运费
 */
public class LogisticsAdapter extends BaseQuickAdapter<LogisticsData.Result.Order, BaseViewHolder> {

    Context context;
//    List<HomeLike.Data.Records> data;
    public LogisticsAdapter(Context context, @Nullable List<LogisticsData.Result.Order> data) {
        super(R.layout.item_logistics, data);
        this.context = context;

    }


    @Override
    protected void convert(@NonNull BaseViewHolder helper,LogisticsData.Result.Order item) {

        if (item != null) {
//            LogUtils.v("searchadapter---" + item);

             helper.setText(R.id.tv_express_text,item.getStatus());
             helper.setText(R.id.tv_express_time,item.getTime());

             ImageView imageView  =  helper.getView(R.id.iv_expres_spot);
             if(helper.getAdapterPosition() == 0){
                 imageView.setBackground(context.getResources().getDrawable(R.drawable.corners_btn_common_default));
             }else {
                 imageView.setBackground(context.getResources().getDrawable(R.drawable.login_corner_shape_disable));
             }
        }


    }
}
